package com.tanhua.management.interceptor;

import com.tanhua.management.domain.User;

public class ManagerHolder {

    private static ThreadLocal<User> tl = new ThreadLocal<>();

    // 将User放入threadlocal的方法
    public static void saveUser(User user){
        tl.set(user);
    }

    // 将User从threadlocal取出方法
    public static User getUser(){
        return tl.get();
    }

    //将User从threadlocal删除方法
    public static void remove(){
        tl.remove();
    }
}
